package com.smart.model.convert;

import com.smart.model.dtomapper.QrCodeDtoMapper;
import com.smart.model.domain.QrCodeDO;
import com.smart.model.vo.QrCodeVO;
import com.google.common.collect.Lists;
import org.apache.commons.collections4.CollectionUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zhanghong
 */
public class QrCodeConvert {

    public static List<QrCodeVO> buildQrCodeVoList(List<QrCodeDO> qrCodeDOList) {
        if (CollectionUtils.isEmpty(qrCodeDOList)) {
            return Lists.newArrayList();
        }
        List<QrCodeVO> qrCodeVOList = new ArrayList<>();
        for (QrCodeDO qrCodeDO : qrCodeDOList) {
            qrCodeVOList.add(QrCodeDtoMapper.INSTANCE.do2VO(qrCodeDO));
        }

        return qrCodeVOList;
    }
}
